/**
 * @file mallHome.js
 * @author hj
 * @date 2016-11-10
 */
import Vue from 'vue';
import App from 'src/app';
import Router from 'vue-router';

require('./mall.css');
require('./base.css');

/* 加载页面 */
import index from './vue/index.vue';
import news from './vue/news.vue';
import classify from './vue/classify.vue';
import goodsList from './vue/goodsList.vue';
import goods from './vue/goods.vue';

Vue.use(Router);

var router = new Router();
router.map({
  '/': {
    component: index
  },
  '/:data': {
    component: index
  },
  '/news': {
    component: news
  },
  '/classify': {
    component: classify
  },
  '/goodsList': {
    component: goodsList,
    name: 'goodsList'
  },
  '/goods/:id': {
    name: 'goods',
    component: goods
  }
});
router.beforeEach(function () {
  window.scrollTo(0, 0);
});
router.redirect({
  '*': '/'
});
router.start(App, 'html');
